<!--
  // Ubiquity provides a standards-based suite of browser enhancements for
  // building a new generation of internet-related applications.
  //
  // The Ubiquity RDFa module adds RDFa support to the Ubiquity library.
  //
  // Copyright (C) 2007-8 Mark Birbeck
  //
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  //
  //  http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software
  // distributed under the License is distributed on an "AS IS" BASIS,
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  // See the License for the specific language governing permissions and
  // limitations under the License.
-->
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:fresnel="http://www.w3.org/2004/09/fresnel#"
	xmlns:argot="http://argot-hub.googlecode.com/"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
  <head typeof="fresnel:Group">
		<title>Calendar actions</title>
    <link rel="stylesheet" href="cal.css" />
	</head>
  <body rev="fresnel:group">
	  <div property="argot:constructor">
      document.Yowl.register(
        "cal",
        [ "Found an event" ],
        [ "Found an event" ],
        "formats/icon-hcalendar.png"
      );
	  </div>

    <span typeof="fresnel:Format">
      <span property="fresnel:instanceFormatDomain" datatype="argot:jsparqlSelector">
        select: [ "summary", "description", "location", "dtstart" ],
        where:
        [
          { pattern: [ "?event", "a", "http://www.w3.org/2002/12/cal/ical#Vevent" ], setUserData: true },
          
          /*
          * Add any additional properties that we need.
          */

          { pattern: [ "?event",  "http://www.w3.org/2002/12/cal/ical#summary",     "?summary"      ], optional: true },
          { pattern: [ "?event",  "http://www.w3.org/2002/12/cal/ical#description", "?description"  ], optional: true },
          { pattern: [ "?event",  "http://www.w3.org/2002/12/cal/ical#location",    "?location"  ],    optional: true },
          { pattern: [ "?event",  "http://www.w3.org/2002/12/cal/ical#dtstart",     "?dtstart"  ],     optional: true }
        ]
      </span>

      <span property="fresnel:resourceStyle" datatype="fresnel:styleClass">cal-event</span>
      
      <span property="argot:yowl">
        document.Yowl.notify(
          "Found an event",
          ${summary.content},
          ${summary.content},
          "cal",
          ${depiction},
          true,
          0
        );
      </span>

      <div rel="argot:tooltip">
        <span rel="argot:icon" resource="icon-hcalendar.png"></span>
        <div property="argot:template" datatype="rdf:XMLLiteral">
          <div class="cal-vevent" style="width: 150px;">
            <span class="cal-summary">${summary.content}</span>
            <span class="cal-location">${location.content}</span>
            <span class="cal-dtstart">${dtstart.content}</span>
          </div>
        </div>
      </div>
    </span>

	</body>
</html>
